#include "fxcc/yml/Serializer.h"
#include "fxcc/core/graph/common/Transform.h"

using namespace YAML;
using namespace fxcc::yml;
using namespace fxcc::graph::common;

template<>
void Serializer::Encode<Transform>(YAML::Node& node, const Transform& inst)
{
	Encode<fxcc::Base>(node, inst);

	SetVariable<glm::vec3>(node, "Position", inst.m_Position);
	SetVariable<glm::vec3>(node, "Rotation", inst.m_Rotation);
	SetVariable<glm::vec3>(node, "Scale", inst.m_Scale);
}


template<>
bool Serializer::Decode<Transform>(const YAML::Node& node, Transform& inst)
{
	Decode<fxcc::Base>(node, inst);

	GetVariable<glm::vec3>(node, "Position", inst.m_Position);
	GetVariable<glm::vec3>(node, "Rotation", inst.m_Rotation);
	GetVariable<glm::vec3>(node, "Scale", inst.m_Scale);
	return true;

}